import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-11-10
 * Time:15:02
 * Text：
 */
public class text6 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int t=sc.nextInt();
        int count=0;
        int[][] array=new int[n+1][m+1];
        for(int i=0;i<t;i++){
            int r1=sc.nextInt();
            int c1=sc.nextInt();
            int r2=sc.nextInt();
            int c2=sc.nextInt();
            for(int k=r1;k<=r2;k++){
                for(int r=c1;r<=c2;r++){
                    array[k][r]=1;
                }
            }
        }
        for(int i=1;i<n+1;i++){
            for(int k=1;k<m+1;k++){
                if(array[i][k]==0)
                    count++;
            }
        }
        System.out.println(count);
    }
}


